#!/bin/bash

echo $$ > alarm.pid

while true
do
    sleep 10
    fail=0
    if [ ! -f universe.pid ]; then
        fail=1
    else
        pid=`cat universe.pid`
        if [ ! -d "/proc/${pid}" ]; then
            fail=1
        fi
    fi

    #if [ $fail -eq 1 ]; then
    #    if [ -f /usr/local/services/CloudDCAgent_L5-1.0/alarm/cloud_alarm ];then
    #        /usr/local/services/CloudDCAgent_L5-1.0/alarm/cloud_alarm 100712667 "error universe $1"
    #    fi
    #fi
    sleep 50
done
